package com.baizan.daka.net

import com.baizan.daka.mvp.model.bean.*
import com.baizan.daka.net.bean.*
import com.hazz.kotlinmvp.net.BaseResponse
import io.reactivex.Observable
import io.reactivex.annotations.NonNull
import okhttp3.MultipartBody
import retrofit2.http.*


interface ApiService {

    @GET("/orderChannel/list")
    fun getPayChannelList():Observable<BaseResponse<List<PayChannelBean>>>

    @POST("/userBank/addBankCode")
    fun addBankCode(@Body param: HashMap<String, String>): Observable<BaseResponse<String>>


    @POST("/userBank/updateBankCode")
    fun updateBankCode(@Body param: HashMap<String, String>): Observable<BaseResponse<String>>


    @GET("/userBank/getBankCode")
    fun getBankCode(): Observable<BaseResponse<String>>

    @POST("/user/teamDetail")
    fun teamDetail(@Body taskRequestBean: BasePageParam<UserTeamDesParam>): Observable<BaseResponse<BasePageResponse<UserTeamDesBean>>>

    @GET("/fileApp/appInfo?appType=2")
    fun getAppUpdate(): Observable<BaseResponse<AppVerSionBean>>

    @GET("/user/packageDetail")
    fun userPackageDes(): Observable<BaseResponse<UserPackageDes>>

    @GET("/user/invitationCode")
    fun invitationCode(): Observable<BaseResponse<String>>

    @GET("/passwordQuestion/list")
    fun passwordQuestion(): Observable<BaseResponse<List<QuestionBean>>>

    @POST("/userBank/edit")
    fun modifyBank(@Body map: HashMap<String, Any>): Observable<BaseResponse<Any>>

    @POST("/userBank/add")
    fun addBank(@Body map: HashMap<String, String>): Observable<BaseResponse<Any>>

    @POST("/capital/withdrawal/apply")
    fun applyShowCash(@Body map: HashMap<String, String>): Observable<BaseResponse<Any>>

    @POST("/user/updatePassword")
    fun modifyPassword(@Body map: HashMap<String, String>): Observable<BaseResponse<Any>>

    @POST("/modify/password")
    fun findPassword(@Body registBean: FindPasswordBean): Observable<BaseResponse<Any>>

    @GET("/userBank/myCard")
    fun getBankDetail(): Observable<BaseResponse<BankCardInfoBean>>

    @GET("/order/payOrder")
    fun payOrder(
        @Query("goodsId") goodsId: Long
        , @Query("goodsType") goodsType: Int
        , @Query("payType") payType: Int
    ): Observable<BaseResponse<String>>

    @GET("/order/payOrder")

    fun payOrderHtml(
        @Query("goodsId") goodsId: Long
        , @Query("goodsType") goodsType: Int
        , @Query("payType") payType: String
    ): Observable<String>


    @POST("/task/edit")
    fun upOrDown(@Body upOrDownBean: UpOrDownBean): Observable<BaseResponse<Any>>

    @GET("/vip/list")
    fun vipList(): Observable<BaseResponse<List<VipBean>>>

    @POST("/user/teamList")
    fun teamList(@Body userPackage: BasePageParam<UserTeamBean>): Observable<BaseResponse<List<MyTeam>>>

    @POST("/capital/list")
    fun capitalList(@Body userPackage: BasePageParam<UserCaplitalDesRequestBean>): Observable<BaseResponse<BasePageResponse<UserCaplitalDes>>>

    @POST("/user/publishTaskList")
    fun publishTaskList(@Body userPackage: BasePageParam<UserPublishTaskRequestBean>): Observable<BaseResponse<BasePageResponse<TaskInfoBean>>>

    @POST("/user/packageList")
    fun userPackageList(@Body userPackage: BasePageParam<UserVipsRequestBean>): Observable<BaseResponse<BasePageResponse<PakeageInfoBean>>>

    @POST("/task/publishTask")
    fun publishTask(@Body publishBean: PublishBean): Observable<BaseResponse<String>>

    @GET("/user/info")
    fun getUserInfo(): Observable<BaseResponse<UserInfoBean>>

    /**
     * 注册
     */
    @POST("/common/regist")
    fun regist(@Body registBean: RegistBean): Observable<BaseResponse<String>>

    @POST("modify/userInfo")
    fun modifyUser(@Body modifyUserBean: ModifyUserBean): Observable<BaseResponse<String>>

    /**
     * 获取验证码
     */
    @POST("/common/getRegistCode")
    fun getRegistCode(@Body phone: SendCodeRequestBean): Observable<BaseResponse<RegistInfoBean>>

    /**
     * 登录
     */
    @POST("/common/login")
    fun login(@Body loginRequestBean: LoginRequestBean): Observable<BaseResponse<LoginInfoBean>>

    /**
     * 注销
     */
    @POST("/common/logout")
    fun logout(@Body map: Map<String, String>): Observable<BaseResponse<Any>>


    /**
     * 获取新闻详情
     */
    @GET("/news/detail")
    fun getNewsDetail(@NonNull @Query("id") id: String): Observable<BaseResponse<NewsDetailBean>>

    /**
     * 任务列表
     */
    @POST("/task/list")
    fun getTaskList(@Body taskRequestBean: BasePageParam<TaskParamBean>): Observable<BaseResponse<BasePageResponse<TaskInfoBean>>>

    /**
     * 任务详情
     */
    @GET("/task/detail")
    fun getTaskDetail(@NonNull @Query("id") id: Int): Observable<BaseResponse<NewsDetailBean>>

    /**
     * 完成任务，提交任务
     */
    @POST("/user/submitTask")
    fun submitTask(@Body submitBean: TaskSubmitBean): Observable<BaseResponse<String>>

    /**
     * 领取任务
     */
    @POST("/user/receivedTask")
    fun receivedTask(@Body taskId: TaskIdBean): Observable<BaseResponse<Any>>

    /**
     * 用户任务列表
     */
    @POST("/user/taskList")
    fun userTaskList(@Body taskRequestBean: BasePageParam<MyTaskBean>): Observable<BaseResponse<BasePageResponse<TaskInfoBean>>>

    /**
     * 套餐列表
     */
    @POST("/packages/list")
    fun packagesList(@Body vipRequest: BasePageParam<TaskParamBean>): Observable<BaseResponse<BasePageResponse<PackageBean>>>

    /**
     * 文件上传
     */
    @Multipart
    @POST("/file/upload")
    fun upLoadFile(@Part parts: MultipartBody.Part): Observable<BaseResponse<String>>

    /**
     * 获取banner
     */
    @GET("/news/banner")
    fun getBanner(): Observable<BaseResponse<List<BannerBean>>>

    /**
     * 任务列表
     */
    @POST("/news/list")
    fun getNewsList(@Body taskRequestBean: BasePageParam<TaskParamBean>): Observable<BaseResponse<BasePageResponse<NewsInfoBean>>>


    /**
     * 通知
     */
    @GET("/newsPrize/list")
    fun getNoticeList(): Observable<BaseResponse<List<NoticeInfoBean>>>

    /**
     * 提现记录
     */
    @POST("/capital/withdrawal/record")
    fun getShowCashList(@Body pageParam: BasePageParam<ShowCashRequest>):
            Observable<BaseResponse<BasePageResponse<ShowCashBean>>>

}